Skip to content

Get thumbnail attachment shell - #198

Merged
mm-omdi merged 85 commits into
developfrom
1273-get-thumbnail-attechment-shell
Aug 12, 2026
Merged

Get thumbnail attachment shell#198
mm-omdi merged 85 commits into
developfrom
1273-get-thumbnail-attechment-shell

Conversation

@mm-omdi

@mm-omdi mm-omdi commented Aug 7, 2026

Copy link
Copy Markdown

This pull request introduces and tests the new "Get Thumbnail By Id" API endpoint for the AAS Repository, which allows clients to retrieve the thumbnail image for a given Asset Administration Shell (AAS) by its identifier. The changes include the addition of example API requests, new unit and integration tests, and necessary dependency injections to support streaming thumbnail files.

Key changes include:

API Additions

  • Added three example request files (Get Thumbnail By Id.bru) for different products in the API collection, demonstrating how to call the new thumbnail endpoint with various AAS identifiers. [1] [2] [3]

Integration and Unit Testing

  • Added comprehensive integration tests in AasRepositoryControllerTests.cs to verify:
    • Successful retrieval of a thumbnail as a stream with correct content type and bytes.
    • Proper handling of missing thumbnails (returns 404).
  • Added unit tests in AasRepositoryControllerTests.cs, AasRepositoryHandlerTests.cs, and AasRepositoryServiceTests.cs to ensure:
    • The handler and service correctly return file streams or throw exceptions as appropriate.
    • The service supports HTTP-based thumbnails and throws for unsupported schemes. [1] [2] [3]

Dependency Injection and Mocks

  • Injected and mocked IFileAttachmentStreamProvider in test setups to support streaming thumbnail files in tests. [1] [2] [3] [4]
  • Updated handler and service constructors to accept additional dependencies, such as IHttpContextAccessor and configuration options for file attachment size. [1] [2]

Minor Improvements

  • Added necessary using statements for new dependencies and fixed file headers. [1] [2] [3] [4] [5]

These changes ensure the new thumbnail retrieval endpoint is robustly covered by tests and ready for integration.

mm-kgi and others added 30 commits July 2, 2026 09:43
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Refactor the return statement in `SubmodelRepositoryService.cs` to use the C# 8.0 range operator for improved collection handling.

Add comprehensive unit tests in `GetAllSubmodelsControllerTests.cs` to cover various scenarios for the `GetAllSubmodelsAsync` method, including handling of query parameters, paging, and exception cases. Utilize `NSubstitute` for mocking and `Xunit` for test structuring.
…th semaphore and add configuration for concurrent operations limit
Introduce `_templateManagementOptions` in `SubmodelRepositoryServiceTests` to configure `TemplateManagementConfig` with a `ServiceInstance` and `ConcurrentOperationsLimit`. Update the constructor of `SubmodelRepositoryService` to include the new parameter. Add necessary using directives for configuration and options handling.
…tAllSubmodelsAsync functionality and improve request handling
…SubmodelTemplateAsync for improved query handling
…cluding adjustments to semaphore release and data structure initialization.
mm-omdi added 4 commits August 5, 2026 12:32
…SuccessStatusCode with explicit check for success status and throw InternalDataProcessingException on failure.
Replaces direct HTTP streaming with IFileContentProvider and FileAttachmentResult abstractions. Controller now uses FileContentStreamResult with OpenTelemetry tracing. Improves error handling for invalid URLs and removes obsolete code and dependencies. Updates usings for consistency.
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

mm-omdi added 4 commits August 7, 2026 12:29
…ovider with IFileContentProvider and update related methods
…viders with Shared.Providers and update related services
…ean up file content provider by removing unused content type variable
…sts: update expected content type to application/octet-stream and streamline file content retrieval
@mm-omdi
mm-omdi marked this pull request as ready for review August 7, 2026 07:59
@mm-omdi mm-omdi changed the title 1273 get thumbnail attechment shell Get thumbnail attechment shell Aug 10, 2026
…mock thumbnail with expected asset information template and update content type assertion
@mm-asha mm-asha changed the title Get thumbnail attechment shell Get thumbnail attachment shell Aug 11, 2026
mm-asha
mm-asha previously approved these changes Aug 12, 2026
@sonarqubecloud

sonarqubecloud Bot commented Aug 12, 2026

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
1 Accepted issue

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@mm-hsh
mm-hsh self-requested a review August 12, 2026 04:52
@github-actions

Copy link
Copy Markdown

Test & Coverage Report

Test Results Summary

Metric Count
✅ Passed 1605
❌ Failed 0
⏭️ Skipped 0

View Detailed Test Results


Code Coverage

Unit Tests Coverage

Package Line Rate Branch Rate Complexity Health
AAS.TwinEngine.DataEngine 92% 78% 2232
Summary 92% (3620 / 3955) 78% (1480 / 1893) 2232

Minimum allowed line rate is 80%

Module Tests Coverage

Package Line Rate Branch Rate Complexity Health
AAS.TwinEngine.DataEngine 61% 43% 2232
Summary 61% (2405 / 3955) 43% (808 / 1893) 2232

@mm-omdi
mm-omdi merged commit ec94166 into develop Aug 12, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants